package com.hctforgreen.greenservice.machineManager;

import com.hctforgreen.greenservice.ctr.HctController;
import com.hctforgreen.greenservice.model.LocationEntity;
import com.hctforgreen.greenservice.model.PwdEntity;
import com.hctforgreen.greenservice.utils.HctResult;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.view.View;

public abstract class MachineBase {
	protected Activity activity;
	protected HctController controller;
	public MachineBase(Activity context){
		this.activity = context;
		this.controller = new HctController(context);
	}
	/**
	 * 获取组件id，初始化组件
	 */
	public abstract void initView();
	/**
	 * 展示对应机型的组件
	 * 组件赋值
	 */
	public abstract void showView();
	/**
	 * 隐藏对应机型的组件
	 */
	public abstract void hideView();
	/**
	 * 校验各组件是否填写正确
	 */
	public abstract boolean validateView();
	/**
	 * 提交获取密码线程
	 * @throws Exception 
	 */
	public abstract HctResult getPwdResult(PwdEntity paramEntity,LocationEntity locationEntity, boolean isClounServer) throws Exception;
	
	
	protected View findViewById(int id) {
        return activity.findViewById(id);
    }
	protected  String getString(int resId) {
        return activity.getString(resId);
    }
	protected Resources getResources() {
		return activity.getResources();
	}
	protected Looper getMainLooper() {
        return activity.getMainLooper();
    }
	protected Context getApplicationContext(){
		return activity.getApplicationContext();
	}
}
